package com.ctosb.classviewer.clazz.attr;

import com.ctosb.classviewer.ClassReader;
import com.ctosb.classviewer.clazz.AbstractParse;
import com.ctosb.classviewer.clazz.Parseable;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class Parameter_annotation extends AbstractParse {

    private short num_annotations;
    private Annotation annotations[];

    @Override
    public Parameter_annotation parse(ClassReader classReader) {
        num_annotations = classReader.readShort();
        annotations = new Annotation[num_annotations & 0xffff];
        for (int i = 0; i < annotations.length; i++) {
            annotations[i] = new Annotation().parse(classReader, getClassFile());
        }
        return this;
    }
}
